# coding=utf-8

import sys
import web
import settings

from hooks import load_hook, unload_hook

# 加载用户账户子程序
from applications.account import app_account

urls = (
	# 首页
	'/', 'index',
	# 用户账户相关功能
	'/account', app_account,
)

app = web.application(urls, globals())
# processor
app.add_processor( web.loadhook( load_hook ) )
app.add_processor( web.unloadhook( unload_hook ) )

class index:
	def GET(self):
		i = web.input()
		lang = i.get('lang', 'zh-TW')

		print >> sys.stderr, 'Language:', lang

		return settings.RENDER.index()

if __name__ == '__main__':
	app.run()
